﻿@{
    var attributes = new Dictionary<string, object>();

    attributes.Add("class", "text-box multi-line");
    attributes.Add("placeholder", ViewData.ModelMetadata.Watermark);

    //If this is true, IsRequired and other constraints 
    //won't necessarily apply in the browser, but in case script 
    //turns off readonly we want the constraints passed
    if (ViewData.ModelMetadata.IsReadOnly)
    {
        attributes.Add("readonly", "readonly");
    }

    if (ViewData.ModelMetadata.IsRequired)
    {
        attributes.Add("required", "required");
    }
}
@Html.TextArea(string.Empty, ViewData.TemplateInfo.FormattedModelValue.ToString(), 0, 0, attributes)